/*
 * @Copyright: 2025 Copyright (C) AMCAX, All rights reserved.
 * @Author: Zhang
 * @Date: 2025/7/24 19:39
 * @LastEditTime: 2025/7/24 19:39
 * @LastEditors: Zhang
 * @Description:
 */

import { ICommandLayout, TCmdGroup } from '@/components/types';
import { FeatureManager } from '@amcax/base';
import { Flex } from 'antd';
import { CmdButton } from '@/components/CmdBar/CmdButtons';
import {
  cmdSurfaceSegmentation,
  cmdSurfaceMerge,
  cmdSurfaceProjection,
  cmdSurfaceStretch,
  cmdSurfaceFitting,
  cmdSurfaceMontage,
  cmdUniformDeform,
  cmdDeform,
  cmdSurfaceLocation,
} from '@/commands/surfaceFeatures';
const EditLayout = () => {
  return (
    <Flex>
      {FeatureManager.isFeatureEnabled('cmd-surface-segmentation') && (
        <CmdButton cmd={cmdSurfaceSegmentation} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-surface-merge') && (
        <CmdButton cmd={cmdSurfaceMerge} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-surface-projection') && (
        <CmdButton cmd={cmdSurfaceProjection} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-surface-stretch') && (
        <CmdButton cmd={cmdSurfaceStretch} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-surface-fitting') && (
        <CmdButton cmd={cmdSurfaceFitting} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-surface-montage') && (
        <CmdButton cmd={cmdSurfaceMontage} />
      )}

      {FeatureManager.isFeatureEnabled('cmd-surface-location') && (
        <CmdButton cmd={cmdSurfaceLocation} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-uniform-deform') && (
        <CmdButton cmd={cmdUniformDeform} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-deform') && (
        <CmdButton cmd={cmdDeform} />
      )}
    </Flex>
  );
};

const cmdGroups: TCmdGroup[] = [
  {
    id: 'draw',
    label: '编辑',
    layout: <EditLayout />,
    visible: true,
  },
];

export const surfaceFeatures: ICommandLayout = {
  id: 'surfaceFeatures',
  label: '曲面功能',
  cmds: cmdGroups,
};
